package org.micropayment.model.data;

import java.util.ArrayList;
import java.util.List;
import org.micropayment.model.MicropaymentAuthority;
import org.micropayment.model.MicropaymentUser;
import org.micropayment.utils.DateUtils;

/**
 *
 * @author jj
 */
public class UserData {
    //TODO. improve this!!!
    //Class for populating DB for first use with prototype.
    public static List<MicropaymentUser> getMicropaymentUsers() {
        ArrayList<MicropaymentUser> userList = new ArrayList<MicropaymentUser>();
        MicropaymentUser user1 = new MicropaymentUser(null,
                MicropaymentAuthority.ROLE_USER, "user1", "user1@gruposp2p.org",
                DateUtils.getTodayDate(), DateUtils.getTodayDate(), "userID1", 
                "passwordUser1", Boolean.FALSE, Boolean.FALSE, Boolean.FALSE);
        user1.setEnabled(Boolean.TRUE);
        userList.add(user1);
        MicropaymentUser user2 = new MicropaymentUser(null,
                MicropaymentAuthority.ROLE_USER, "user2", "user2@gruposp2p.org",
                DateUtils.getTodayDate(), DateUtils.getTodayDate(), "userID2",
                "passwordUser2", Boolean.FALSE, Boolean.FALSE, Boolean.FALSE);
        user2.setEnabled(Boolean.TRUE);
        userList.add(user2);
        MicropaymentUser user3 = new MicropaymentUser(null,
                MicropaymentAuthority.ROLE_USER, "user3", "user3@gruposp2p.org",
                DateUtils.getTodayDate(), DateUtils.getTodayDate(), "userID3",
                "passwordUser3", Boolean.FALSE, Boolean.FALSE, Boolean.FALSE);
        user3.setEnabled(Boolean.TRUE);
        userList.add(user2);
        return userList;
    }


   public static MicropaymentUser getMicropaymentUser () {
        MicropaymentUser user = new MicropaymentUser ();
        user.setName("JJ");
        user.setPhone("55555");
        user.setPassword("nkk");
        user.setEmail("aaa@gmail.com");
        user.setAuthority(MicropaymentAuthority.ROLE_USER);
        user.setDateAdded(DateUtils.getTodayDate());
        user.setLastEntryDate(DateUtils.getTodayDate());
        user.setUserid("userID");
        user.setAccountExpired(Boolean.FALSE);
        user.setAccountLocked(Boolean.FALSE);
        user.setCredentialsExpired(Boolean.TRUE);
        user.setEnabled(Boolean.TRUE);
        return user;
    }

}
